﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style x:Key="ExpandedListBoxItem"
           TargetType="{x:Type ListBoxItem}">
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="HorizontalContentAlignment"
                Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="VerticalContentAlignment"
                Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="Padding"
                Value="2,0,0,0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Expander Margin="5">
                        <Expander.Header>
                            <TextBlock Text="{Binding GroupName}" />
                        </Expander.Header>
                        <Expander.Content>
                            <ListBox ItemsSource="{Binding ApiMethods}"
                                     SelectedItem="{Binding CurrentApiMetod, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     BorderThickness="0" />
                        </Expander.Content>
                    </Expander>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>